-
Notifications
You must be signed in to change notification settings - Fork 39
Introduce skipCQL4MetadataResolveMethod to address CQL4 issues #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce skipCQL4MetadataResolveMethod to address CQL4 issues #463
Conversation
|
Do we have tests to prove it works correctly? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR introduces a new mechanism, skipCQL4MetadataResolveMethod, to address a flaw in CQL4 prepared statement metadata handling. Key changes include:
- Adding a new method, calculateSkipMetadata(), in DefaultPreparedStatement to decide whether to skip metadata resolution.
- Integrating a configurable CQL4SkipMetadataResolveMethod within QueryOptions with new setters and getters.
- Adjusting SessionManager to use the new skip metadata logic based on whether the statement is a DefaultPreparedStatement.
Reviewed Changes
| File | Description |
|---|---|
| driver-core/src/main/java/com/datastax/driver/core/DefaultPreparedStatement.java | Adds skip metadata logic and logging to warn about wildcard selects and UDT usage |
| driver-core/src/main/java/com/datastax/driver/core/QueryOptions.java | Introduces new configuration methods and enum for CQL4 skip metadata resolution |
| driver-core/src/main/java/com/datastax/driver/core/SessionManager.java | Updates logic to determine skip metadata based on statement type |
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
driver-core/src/main/java/com/datastax/driver/core/DefaultPreparedStatement.java:201
- The variable 'query' is undefined in this method. Consider passing the query string as an argument or referencing a valid class field to resolve this issue.
List<String> chunks = Splitter.onPattern("\s+").splitToList(query);
Not yet |
3c03a6b to
a3e97e6
Compare
Added |
1efbba1 to
30ea2e9
Compare
Introduce skipCQL4MetadataResolveMethod to Mitigate CQL4 Issues CQL4 has a flaw where, after a schema change, an affected prepared statement may not be invalidated on the client side. As a result, the driver may read data that does not match the cached metadata, leading to deserialization failures or incorrect deserialization. For more details, see: scylladb/scylladb#20860. This commit introduces the skipCQL4MetadataResolveMethod, which determines how the driver resolves the skip metadata flag for CQL4 prepared statements. It supports three modes: `SMART` (default) – Disables the skip metadata flag only for wildcard selects and selects that return UDTs (including collections and maps). `ENABLED` – Always enables the skip metadata flag, no metadata is being sent. `DISABLED` – Always disables the skip metadata flag, metadata is being sent with every bound statement RESULT frame.
30ea2e9 to
1276914
Compare
Fixes: #460
CQL4has a flaw where, after a schema change, an affected prepared statement may not be invalidated on the client side. As a result, the driver may read data that does not match the cached metadata, leading to deserialization failures or incorrect deserialization.For more details, see: scylladb/scylladb#20860.
This commit introduces the
skipCQL4MetadataResolveMethod, which determines how the driver resolves the skip metadata flag forCQL4prepared statements. It supports three modes:SMART (default)– Disables the skip metadata flag only for wildcard selects and selects that return UDTs (including collections and maps).ENABLED– Always enables the skip metadata flag, metadata is being sent with every query.DISABLED– Always disables the skip metadata flag, metadata is not being sent.